package com.wv.api;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@SpringBootApplication(scanBasePackages = {"com.wv"})
@MapperScan("com.wv.api.mapper")
@EnableTransactionManagement // 开启事务
public class ApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class,args);
    }

    @PostConstruct
    void started() {
        // 设置用户时区为 UTC
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
    }

}
